﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Blank.Master" Inherits="System.Web.Mvc.ViewPage<SacNetUG.Models.Event>" %>

<%@ Import Namespace="SacNetUG.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Agenda
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        body
        {
            background-color: #FFFFFF;
            font-family: Verdana, Arial, Helvetica, sans-serif;
            font-size: small;
            margin-left: 6px;
            margin-right: 6px;
        }
        .h1
        {
            font-family: Verdana, Arial, Helvetica, sans-serif;
            font-size: small;
            font-weight: bold;
            padding-bottom: 0px;
        }
        .bodyTable
        {
            font-size: x-small;
            width: 600px;
            text-align: left;
            padding: 2px;
            vertical-align: top;
        }
        .bodyTable td
        {
            font-size: x-small;
            vertical-align: top;
        }
        .title
        {
            font-size: small;
        }
    </style>
    <%
        var eventSponsorIds = new int[] { 12 };
        if (Model.EventSponsors.Count > 0)
            eventSponsorIds = Model.EventSponsors.Select(p => p.SponsorId).ToArray();


        var db = new SacNetUGDataContext();
        var eventSponsors =
            db.EventSponsors.Where(p => eventSponsorIds.Contains(p.SponsorId) & p.EventId == Model.EventId);

        //use the first sponsor as the image
        var firstSponsor = eventSponsors.FirstOrDefault();

        var sponsor = firstSponsor == null ? db.Sponsors.Where(p => p.SponsorId == 12).FirstOrDefault() : firstSponsor.Sponsor;


        var presenterNames = Model.EventPresenters.Aggregate("",
                                                             (current, eventPresenter) =>
                                                             current + (eventPresenter.User.Name + ", "));
    %>
    <table border="0" cellpadding="2" cellspacing="2" style="width: 592px;">
        <tr>
            <td>
                <a href="http://www.sacnetug.org">
                    <img src="http://sacnetug.org/Content/sacDotNetLogo.png" border="0" /></a>
            </td>
            <td style="text-align: right;">
                <a href="<%=sponsor.Url%>">
                    <img src="<%=sponsor.LogoUrl%>" border="0">
                </a>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <hr align="center" size="1" width="100%" />
            </td>
        </tr>
        <tr>
            <td colspan="2" style="text-align: center;">
                <strong>Agenda for <%:Model.StartDate.ToLongDateString()%> Meeting<br />
                    <%:Model.Name%></strong>
            </td>
        </tr>
        <tr>
            <td style="vertical-align: top; font-weight: bold;">
                When:
            </td>
            <td>
                <%:string.Format("{0:MMM dd, yyyy}", Model.StartDate)%> from 6:00 to 8:15 PM
            </td>
        </tr>
        <tr>
            <td style="vertical-align: top; font-weight: bold;">
                RSVP:
            </td>
            <td>
                Seating based on availability- <strong>RSVP Recommended</strong>.<br />
                Please RSVP at <%: Html.ActionLink("http://www.sacnetug.org/event/rsvp", "RSVP", "Event", null, new { target = "_blank" })%> (<em>login required</em>)
            </td>
        </tr>
        <tr>
            <td style="vertical-align: top; font-weight: bold;">
                Where:
            </td>
            <td>
                UC Davis Extension, Room 200A, Sacramento.<br />
                Sutter Square Galleria, 2901 K St., Sacramento, CA 95816
            </td>
        </tr>
        <tr>
            <td style="vertical-align: top; font-weight: bold;">
                Directions:
            </td>
            <td>
                2901 K St. is between 29th and 30th and K&amp;J Streets<br />(<a href="http://extension.ucdavis.edu/facilities/galleria_map.asp"
                    rel="nofollow" target="_blank">Map &amp; Directions</a>)
                <br />
                <strong>Business I-80 northbound: </strong>Take the N Street exit. Continue north
                on 30th Street for three blocks and turn left on K Street. Turn right into the parking
                garage.<br />
                <strong>Business I-80 southbound: </strong>Take the J Street exit. At the first
                stoplight (immediately after the exit), turn left on J Street. Turn right into the
                parking garage.
            </td>
        </tr>
        <tr>
            <td style="vertical-align: top; font-weight: bold;">
                Parking:
            </td>
            <td>
                UC Davis Extension Parking Garage 1st and 2nd Floors. Discounted parking is available
                with validation. Please bring your parking ticket to the meeting.
            </td>
        </tr>
        <tr>
            <td style="vertical-align: top; font-weight: bold;">
                Speakers:
            </td>
            <td>
                <%foreach (var presenter in Model.EventPresenters)
        {
            if (!string.IsNullOrEmpty(presenter.User.ImageUrl))
            {%>
                            <em><%:presenter.User.Name%></em>
                            <%
            }
        }%>
                
            </td>
        </tr>
        <tr>
            <td style="vertical-align: top; font-weight: bold;">
                Topic:
            </td>
            <td>
                <%:Model.Name%>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <b>Agenda</b>:
                <table border="0" cellpadding="0" cellspacing="0" style="width: 100%; border: 1px solid black;">
                    <tr>
                        <td>
                            6:00 PM
                        </td>
                        <td>
                            6:10 PM
                        </td>
                        <td>
                            Registration &amp; Networking
                        </td>
                    </tr>
                    <tr>
                        <td>
                            6:10 PM
                        </td>
                        <td>
                            8:10 PM
                        </td>
                        <td>
                            <p>
                            Seminar / Workshop / QA
                        </td>
                    </tr>
                    <tr>
                        <td>
                            8:10 PM
                        </td>
                        <td>
                            8:15 PM
                        </td>
                        <td>
                            Raffle
                        </td>
                    </tr>
                </table>
                <b>Sponsors of this meeting:</b> <br />
                Raffle Prizes and Books sponsored by Microsoft-CodeZone.<br />
                We will be raffling off books and other gifts from CodeZone<br />
                <br />
                Space sponsored by <a href="http://www.questsys.com/" rel="nofollow" target="_blank">
                    <font color="#0000ff">Quest</font></a>
                <p>
                    Refreshments will be provided.<br />
                    <br />
                    Please read the
                    <%: Html.ActionLink("event details", "Index", "Event") %>
                    for more information about the event. If you have difficulty reading this email,
                    you can
                    <%: Html.ActionLink("view the agenda", "Agenda", "Event") %>
                    online.<br />
                    <br />
                    We look forward to seeing you at the event.<br />
                    Not a member? register at
                    <%: Html.ActionLink("http://www.sacnetug.org", "Index", "Home") %>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <span style="font-size: 7.5pt;">This email is sent to only registered members with a
                    username and password. If you do not like to receive event announcements in future,
                    please login and change your email options</span>
            </td>
        </tr>
    </table>
</asp:Content>
